import binascii
import hashlib

import base58


def convert_pubkey_to_account(pubkey: str) -> str:
    sha256_value = hashlib.sha256(binascii.unhexlify(pubkey)).digest()
    ripemd160 = hashlib.new('ripemd160')
    ripemd160.update(sha256_value)
    ripemd160_value = ripemd160.digest()
    address = b"\x00" + ripemd160_value
    checksum = hashlib.sha256(hashlib.sha256(address).digest()).digest()[:4]
    address = base58.b58encode(address + checksum)
    return address.decode()
